<!DOCTYPE html>
<html class="client-nojs vector-feature-night-mode-disabled vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-sticky-header-enabled" lang="en" dir="ltr"><head>
<meta charset="UTF-8">
<title>Gradient-domain image processing</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="https://en.wikipedia.org/wiki/Gradient-domain_image_processing"> <link href="./mw/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/mediawiki.page.gallery.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/user.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./mw/site.styles.css">
<link rel="stylesheet" type="text/css" href="./mw/noscript.css">
<link rel="stylesheet" type="text/css" href="./footer.css">
<link rel="stylesheet" type="text/css" href="./vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Gradient-domain_image_processing rootpage-Gradient-domain_image_processing skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading">
<span id="openzim-page-title" class="mw-page-title-main"><span class="mw-page-title-main">Gradient-domain image processing</span></span>
</h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr"><p><b>Gradient domain image processing</b>, also called <b>Poisson image editing</b>,<sup id="cite_ref-Perez2003_1-0" class="reference"><a href="#cite_note-Perez2003-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> is a type of <a href="Digital_image_processing" title="Digital image processing">digital image processing</a> that operates directly on the differences between neighboring pixels, rather than on the pixel values. Mathematically, an <a href="Image_gradient" title="Image gradient">image gradient</a> represents the <a href="Derivative" title="Derivative">derivative</a> of an image, so the goal of gradient domain processing is to construct a new image by <a href="Integral" title="Integral">integrating</a> the gradient, which requires solving <a href="Poisson's_equation" title="Poisson's equation">Poisson's equation</a>.<sup id="cite_ref-Bhat2010_2-0" class="reference"><a href="#cite_note-Bhat2010-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup>
</p>
<meta property="mw:PageProp/toc">
<div class="mw-heading mw-heading2"><h2 id="Overview">Overview</h2></div>
<p>Processing images in the gradient domain is a two-step process. The first step is to choose an image gradient. This is often extracted from one or more images and then modified, but it can also be obtained through other means. For example, some researchers have explored the advantages of users painting directly in the gradient domain,<sup id="cite_ref-3" class="reference"><a href="#cite_note-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup> while others have proposed sampling a gradient directly from a camera sensor.<sup id="cite_ref-4" class="reference"><a href="#cite_note-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup> The second step is to solve Poisson's equation to find a new image that can produce the gradient from the first step. An exact solution often does not exist because the modified gradient field is no longer <a href="Conservative_vector_field" title="Conservative vector field">conservative</a>, so an image approximating the desired gradient as closely as possible is found.
</p>
<div class="mw-heading mw-heading2"><h2 id="Image_editing">Image editing</h2></div>
<p>The gradient is obtained from an existing image and modified for <a href="Image_editing" title="Image editing">image editing</a> purposes. Various operators, such as <a href="Finite_difference" title="Finite difference">finite difference</a> or <a href="Sobel_operator" title="Sobel operator">Sobel</a>, can be used to find the gradient of a given image. This gradient can then be manipulated directly to produce several different effects when the resulting image is solved for. For example, if a uniform constant scales the gradient, it results in a simple sharpening filter. A better sharpening filter can be made by only scaling the gradient in areas deemed important.<sup id="cite_ref-Bhat2010_2-1" class="reference"><a href="#cite_note-Bhat2010-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup>
Other uses include seamless <a href="Image_stitching" title="Image stitching">image stitching</a>,<sup id="cite_ref-5" class="reference"><a href="#cite_note-5"><span class="cite-bracket">[</span>5<span class="cite-bracket">]</span></a></sup> removal of unwanted details from an image,<sup id="cite_ref-Perez2003_1-1" class="reference"><a href="#cite_note-Perez2003-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> <a href="Non-photorealistic_rendering" title="Non-photorealistic rendering">non-photorealistic rendering</a> filters,<sup id="cite_ref-Bhat2010_2-2" class="reference"><a href="#cite_note-Bhat2010-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> image <a href="Deblocking" class="mw-redirect" title="Deblocking">deblocking</a>,<sup id="cite_ref-Bhat2010_2-3" class="reference"><a href="#cite_note-Bhat2010-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup>
the ability to seamlessly clone one part of an image onto another in ways that are difficult to achieve with conventional image-domain techniques,<sup id="cite_ref-Perez2003_1-2" class="reference"><a href="#cite_note-Perez2003-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> and <a href="High-dynamic-range_imaging" class="mw-redirect" title="High-dynamic-range imaging">high-dynamic-range imaging</a><sup id="cite_ref-6" class="reference"><a href="#cite_note-6"><span class="cite-bracket">[</span>6<span class="cite-bracket">]</span></a></sup>
These gradient-domain editing techniques can also be extended to moving images by considering a video clip to be a cube of pixels and solving a 3d Poisson equation.<sup id="cite_ref-7" class="reference"><a href="#cite_note-7"><span class="cite-bracket">[</span>7<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading2"><h2 id="Seamless_image_cloning">Seamless image cloning</h2></div>
<p><a href="Digital_compositing" title="Digital compositing">Digital compositing</a> is a common task in image editing in which some or all of one photo is pasted into another. Traditionally, this is done by pasting the pixel values from one image to another. A well-trained artist can make a convincing composite using traditional techniques, but it usually requires time-consuming color correction and mask cutting to make it work. Alternatively, the pasting can be performed in the gradient domain: if the differences between pixels are pasted rather than the actual pixel values, there is sometimes much less user input needed to achieve a clean result. The following example demonstrates the use of gradient-domain image processing to paste from one image to another seamlessly.
</p>
<ul class="gallery mw-gallery-traditional">
<li class="gallerybox" style="width: 235px">
<div class="thumb" style="width: 230px; height: 210px;"><span typeof="mw:File"></span></div>
<div class="gallerytext">Input image A</div>
</li>
<li class="gallerybox" style="width: 235px">
<div class="thumb" style="width: 230px; height: 210px;"><span typeof="mw:File"></span></div>
<div class="gallerytext">Input image B</div>
</li>
<li class="gallerybox" style="width: 235px">
<div class="thumb" style="width: 230px; height: 210px;"><span typeof="mw:File"></span></div>
<div class="gallerytext">Modified gradient. This is the result of pasting the gradient of B onto the gradient of A.</div>
</li>
<li class="gallerybox" style="width: 235px">
<div class="thumb" style="width: 230px; height: 210px;"><span typeof="mw:File"></span></div>
<div class="gallerytext">Reconstructed image. This is the result of solving Poisson's equation on the modified gradient. The seam between the two images is barely visible.</div>
</li>
<li class="gallerybox" style="width: 235px">
<div class="thumb" style="width: 230px; height: 210px;"><span typeof="mw:File"></span></div>
<div class="gallerytext">Traditional image domain paste. This is the result of pasting the pixel values directly from B onto A. There is an obvious seam.</div>
</li>
</ul>
<p>Notice that the hand and the eye shifted color slightly in the image reconstructed from the modified gradient. This happened because the solver was set to find the entire image. However, it is possible to add constraints so that only the pasted section is solved, leaving the rest of the image unmodified. It is also worth noting that the gradient pictured above represents the derivative of only one <a href="Color_channel" class="mw-redirect" title="Color channel">color channel</a> (red) and was rendered with colors representing the strength and direction of the gradient. In practice, two <a href="Grayscale" title="Grayscale">grayscale</a> gradient images are found per color channel, one representing the change in <i>x</i> and the other representing the change in <i>y</i>. Each color channel is solved independently when reconstructing the final image.
</p>
<div class="mw-heading mw-heading2"><h2 id="References">References</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1239543626">
/* start https://en.wikipedia.org/ */
.mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}
/* end https://en.wikipedia.org/ */
</style><div class="reflist">
<div class="mw-references-wrap"><ol class="references">
<li id="cite_note-Perez2003-1"><span class="mw-cite-backlink">^ <a href="#cite_ref-Perez2003_1-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-Perez2003_1-1"><sup><i><b>b</b></i></sup></a> <a href="#cite_ref-Perez2003_1-2"><sup><i><b>c</b></i></sup></a></span> <span class="reference-text"><style data-mw-deduplicate="TemplateStyles:r1238218222">
/* start https://en.wikipedia.org/ */
.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("./mw/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("./mw/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("./mw/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("./mw/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#d33)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#d33)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}
/* end https://en.wikipedia.org/ */
</style><cite id="CITEREFPérezGangnetBlake2003" class="citation book cs1">Pérez, Patrick; Gangnet, Michel; Blake, Andrew (2003). <a rel="nofollow" class="external text" href="https://www.cs.jhu.edu/~misha/Fall07/Papers/Perez03.pdf">"Poisson image editing"</a> <span class="cs1-format">(PDF)</span>. <i>ACM SIGGRAPH 2003 Papers on - SIGGRAPH '03</i>. p. 313. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1145%2F1201775.882269">10.1145/1201775.882269</a>. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <bdi>1581137095</bdi>. <a href="S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a> <a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:6541990">6541990</a>.</cite></span>
</li>
<li id="cite_note-Bhat2010-2"><span class="mw-cite-backlink">^ <a href="#cite_ref-Bhat2010_2-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-Bhat2010_2-1"><sup><i><b>b</b></i></sup></a> <a href="#cite_ref-Bhat2010_2-2"><sup><i><b>c</b></i></sup></a> <a href="#cite_ref-Bhat2010_2-3"><sup><i><b>d</b></i></sup></a></span> <span class="reference-text"><cite id="CITEREFBhatZitnickCohenCurless2010" class="citation journal cs1">Bhat, Pravin; Zitnick, C. Lawrence; Cohen, Michael; Curless, Brian (2010). <a rel="nofollow" class="external text" href="http://grail.cs.washington.edu/projects/gradientshop/demos/gs_paper_TOG_2009.pdf">"Gradient <i>Shop</i>"</a> <span class="cs1-format">(PDF)</span>. <i>ACM Transactions on Graphics</i>. <b>29</b> (2): <span class="nowrap">1–</span>14. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1145%2F1731047.1731048">10.1145/1731047.1731048</a>. <a href="S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a> <a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:3097999">3097999</a>.</cite></span>
</li>
<li id="cite_note-3"><span class="mw-cite-backlink"><b><a href="#cite_ref-3">^</a></b></span> <span class="reference-text"><cite id="CITEREFMcCannPollard2008" class="citation journal cs1">McCann, James; Pollard, Nancy S. (2008). <a rel="nofollow" class="external text" href="http://graphics.cs.cmu.edu/nsp/papers/gradFinal.pdf">"Real-time gradient-domain painting"</a> <span class="cs1-format">(PDF)</span>. <i>ACM Transactions on Graphics</i>. <b>27</b> (3): <span class="nowrap">1–</span>7. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1145%2F1360612.1360692">10.1145/1360612.1360692</a>.</cite></span>
</li>
<li id="cite_note-4"><span class="mw-cite-backlink"><b><a href="#cite_ref-4">^</a></b></span> <span class="reference-text"><cite id="CITEREFTumblinAgrawalRaskar2005" class="citation book cs1">Tumblin, J.; Agrawal, A.; Raskar, R. (2005). "Why I Want a Gradient Camera". <a rel="nofollow" class="external text" href="https://users.cs.northwestern.edu/~jet/docs/2005_1323GradCamFinal.pdf"><i>2005 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR'05)</i></a> <span class="cs1-format">(PDF)</span>. Vol. 1. pp. <span class="nowrap">103–</span>110. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1109%2FCVPR.2005.374">10.1109/CVPR.2005.374</a>. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <bdi>0-7695-2372-2</bdi>. <a href="S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a> <a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:1821571">1821571</a>.</cite></span>
</li>
<li id="cite_note-5"><span class="mw-cite-backlink"><b><a href="#cite_ref-5">^</a></b></span> <span class="reference-text"><cite id="CITEREFLevinZometPelegWeiss2004" class="citation book cs1">Levin, Anat; Zomet, Assaf; Peleg, Shmuel; Weiss, Yair (2004). <a rel="nofollow" class="external text" href="https://webee.technion.ac.il/people/anat.levin/papers/blendingTR.pdf">"Seamless Image Stitching in the Gradient Domain"</a> <span class="cs1-format">(PDF)</span>. <i>Computer Vision - ECCV 2004</i>. Lecture Notes in Computer Science. Vol. 3024. pp. <span class="nowrap">377–</span>389. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1007%2F978-3-540-24673-2_31">10.1007/978-3-540-24673-2_31</a>. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <bdi>978-3-540-21981-1</bdi>.</cite></span>
</li>
<li id="cite_note-6"><span class="mw-cite-backlink"><b><a href="#cite_ref-6">^</a></b></span> <span class="reference-text"><cite id="CITEREFFattalLischinskiWerman2002" class="citation book cs1">Fattal, Raanan; Lischinski, Dani; Werman, Michael (2002). <a rel="nofollow" class="external text" href="https://www.cs.huji.ac.il/~danix/hdr/hdrc.pdf">"Gradient domain high dynamic range compression"</a> <span class="cs1-format">(PDF)</span>. <i>Proceedings of the 29th annual conference on Computer graphics and interactive techniques - SIGGRAPH '02</i>. p. 249. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1145%2F566570.566573">10.1145/566570.566573</a>. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <bdi>1581135211</bdi>. <a href="S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a> <a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:1650337">1650337</a>.</cite></span>
</li>
<li id="cite_note-7"><span class="mw-cite-backlink"><b><a href="#cite_ref-7">^</a></b></span> <span class="reference-text"><cite id="CITEREFWangXuRaskarAhuja2007" class="citation journal cs1">Wang, Hongcheng; Xu, Ning; Raskar, Ramesh; Ahuja, Narendra (2007). "Videoshop: A new framework for spatio-temporal video editing in gradient domain". <i>Graphical Models</i>. <b>69</b>: <span class="nowrap">57–</span>70. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1016%2Fj.gmod.2006.06.002">10.1016/j.gmod.2006.06.002</a>.</cite></span>
</li>
</ol></div></div></div><!--htdig_noindex--><div><div class="zim-footer">
This article is issued from <a class="external text" title="Last edited on 2024-05-16" href="https://en.wikipedia.org/wiki/?title=Gradient-domain_image_processing&oldid=1224142732">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>
</body></html>